<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no" />
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>修改密码-思多客</title>
    <link href="http://cdn.bootcss.com/normalize/7.0.0/normalize.min.css" rel="stylesheet">
    <link rel="stylesheet" href="/public/css/m/public.css">
    <style>
        .invite-content{
            margin: 0.4rem 0;
            padding: 0.5rem 0.4rem;
            font-size: 0.4rem;
            text-align: center;
        }
        .invite-content li{
            line-height: 1.5;
            margin: 0.2rem 0;
        }
        .form-input{
            display: inline-block;
            width: 4.8rem;
            box-sizing: border-box;
            outline: none;
            height: 0.8rem;
            border: 0.0133rem solid #999;
            background-color: #fff;
            margin: 0.12rem 0;
            padding: 0.133rem;
            border-radius: 0.1rem;
            font-size: 0.32rem;
        }
        .save{
            display: inline-block;
            width: 2rem;
            height: 0.8rem;
            line-height: 1.5;
            color: #fff;
            background-color: #ff0000;
            font-size: 0.4rem;
            border-radius: 2px;
            margin: 0 auto;
            outline: none;
            border: none;
        }
    </style>
</head>

<body>
    <div class="n-page">
        <div class="new-header flex">
            <div class="back-box">
                <img src="/public/images/m/back.png" alt="" class="left-back-icon">
            </div>
            <span class="header-title flex-child-box">修改密码</span>
        </div>
        <div class="content invite">
            <div class="center-logo-box">
                <img src="/public/images/m/logo-h.png" alt="" class="logo-icon">
                <span>传播智慧,&nbsp;传承分享</span>
            </div>
            <div class="invite-content">
                <ul id="J_invite" class="invite-content">
                    <li>
                        <label for="oldPwd">旧密码</label>
                        <input type="password" id="oldPwd" class="form-input">
                    </li>
                    <li>
                        <label for="newPwd">新密码</label>
                        <input type="password" id="newPwd" class="form-input">
                    </li>
                    <li>
                        <input type="button" class="save" value="提交" id="save">
                    </li>
                </ul>
            </div>
        </div>
        <div id="footer"></div>
    </div>
    <script src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>
    <script src="/public/js/m/fontResize.js"></script>
    <script src="/public/js/G.js"></script>
    <script src="/public/js/user.js"></script>
    <script src="/public/js/m/public.js"></script>
    <script>
    $(document).on('click','#save',function(){
        var oldSecretkey = $('#oldPwd').val().trim();
        var newSecretkey = $('#newPwd').val().trim();
        if(!oldSecretkey){
            layer.msg('请输入旧密码');
            return;
        }
        if(!newSecretkey){
            layer.msg('请输入新密码');
            return;
        }
        var params = {
            oldSecretkey: oldSecretkey,
            newSecretkey: newSecretkey
        }
        loading.open()
        user.modifyPwd(params,function(){
            loading.close()
            alert('密码修改成功，请重新登录!');
            G.deleteCookie('jwt');
            G.deleteCookie('sdk_user_id');
            G.deleteCookie('sdk_user_type');
            G.deleteCookie('rewardId');
            G.deleteCookie('localUserId');
            location.href = '/m/login.html'
        },function(err){
            loading.close()
            alert(err)
        })
    })
    </script>
</body>

</html>